package com.obas.event {
   import com.ease.framework.CommandCompletionEvent;

   import flash.events.Event;

   [Response(name="{RETURN_ID}", type="com.ease.framework.CommandCompletionEvent")]
   public class ScriptOperationEvent extends Event {

      public static const REQUEST_ID:String = "ScriptOperationEvent_Request";

      public static const RETURN_ID:String = "ScriptOperationEvent_Return";

      public static const START_APP:int = 0;

      public static const START_RECORD:int = 1;

      public static const END_RECORD:int = 2;

      public static const START_RUN:int = 3;

      public static const GET_TREE_ROOT:int = 4;

      public static const GET_PROPERTIES:int = 5;

      public static const TOGGLE_INSPECT_FRAME:int = 6;

      public static const TOGGLE_INSPECT_MODE:int = 7;

      public static const GET_TREE_CHILDREN:int = 8;

      public static const CREATE_VERIFY_CODE:int = 9;

      public static const SAVE_TEST_SCRIPT:int = 10;

      public static const FETCH_TEST_SCRIPT:int = 11;

      public static const STOP_APP:int = 12;

      public static const RUN_TEST_ITEM:int = 13;

      private var _actionType:int = START_RECORD;

      private var _spec:Object=null;

      public function ScriptOperationEvent(spec:Object, actionType:int = START_RECORD, type:String=null) {
         var typeId:String = type;
         if (type == null) {
            typeId=REQUEST_ID;
         }
         super(typeId, true, true);
         _spec = spec;
         _actionType=actionType;
      }

      public override function clone():Event {
         var event:ScriptOperationEvent=new ScriptOperationEvent(spec, actionType, type);
         return event;
      }

      public function get spec():Object {
         return _spec;
      }

      public function get actionType():int {
         return _actionType;
      }
   }
}